<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../../script/jquery-1.7.2.js"></script>
    <script type="text/javascript">
        $(function () {
            console.log($("#term-2").length);
            console.log($("#term-2").prevUntil("dt").length);
            $("#term-2").prevUntil("dt").css("background-color", "#bbffaa");
        });
    </script>
</head>
<body>
    <dl>
        <dt>term 1</dt>
        <dd>definition 1-a</dd>
        <dd>definition 1-b</dd>
        <dd>definition 1-c</dd>
        <dd>definition 1-d</dd>

        <dt id="term-2">term 2</dt>
        <dd>definition 2-a</dd>
        <dd>definition 2-b</dd>
        <dd>definition 2-c</dd>

        <dt>term 3</dt>
        <dd>definition 3-a</dd>
        <dd>definition 3-b</dd>

    </dl>
</body>
</html>